HTML

Up vote 2 down vote favorite share g+ share fb share tw.

In other words how to achive behavior like.

Probably impossible without JavaScript. Can you use it? Can you use jQuery?

– Pekka Mar 3 '11 at 10:12 yes I am very open to any javascript – SonOfOmer Mar 3 '11 at 10:17 check my answer, you can also move the onclick to the type=text field if you want to clear it onclick – Michael Mar 3 '11 at 10:19 What I am looking is input type="text" that does not allow entering vales, but it allows deleting with delete button and backspace button from keyboard – SonOfOmer Mar 3 '11 at 10:25.

Considering this HTML: The following jQuery function will only allow the Backspace key to be used in the input fields with class onlydelete. $('. Onlydelete').

Keypress(function (e) { return (e. Which===8); }); UPDATE: I've found that you also need the Delete key. And I guess you would also like to allow the arrow keys to let the user move the caret.

For these special keys, you can use keydown. The following snippet only allows Delete (46), Backspace (8), and arrow keys (37-40). $('.

Onlydelete'). Keydown(function (e) { return (e. Which===46 || e.

Which===8 || (e. Which>=37 && e. Which For example: .

Onlydelete { background-color: #aaaaaa; }.

If you don't want to change the background to grey, you can add and the following css: inputdisabled {background:white;border:1px solid #7F9DB9} Demo: jsfiddle.net/utw8y/1 Update Using only delete or backspace keys you can use the following jQuery code: $('input'). Keypress(function(event) { if ((event. Which!

='0') && (event. Which! ='8')) { event.preventDefault(); } else { $(this).

Val(""); } }); Demo: jsfiddle.net/utw8y/2.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.